package com.zjh.photoshopstudy.Utils;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;

import com.zjh.photoshopstudy.app.user.UserActivity;

public class CommentUserNameClick extends ClickableSpan {
    private int uid;
    private Context context;

    public CommentUserNameClick(int uid, Context context) {
        this.uid = uid;
        this.context = context;
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        ds.setUnderlineText(false);
    }

    @Override
    public void onClick(@NonNull View view) {
        Intent intent = new Intent(context, UserActivity.class);
        intent.putExtra("uid", uid);
        context.startActivity(intent);
    }
}
